//
//  FreightStatisticsCell.m
//  阿帕
//
//  Created by mac on 2020/1/3.
//  Copyright © 2020 GCY. All rights reserved.
//

#import "FreightStatisticsCell.h"

@implementation FreightStatisticsCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    for (int i=0; i<4; i++) {
        UILabel *textLabel = [[UILabel alloc] initWithFrame:CGRectMake(ScreenW/4*i, 0, ScreenW/4, 60)];
        textLabel.tag = 100 + i;
        textLabel.text = @"-";
        textLabel.textAlignment = NSTextAlignmentCenter;
        textLabel.textColor = Dark_TextColor;
        textLabel.font = font(14);
        textLabel.numberOfLines = 2;
        textLabel.adjustsFontSizeToFitWidth = YES;
        [self.contentView addSubview:textLabel];
    }
    
    //分割线
    UIView *hLine = [[UIView alloc] initWithFrame:CGRectMake(15, 59, ScreenW - 30, 1)];
    hLine.backgroundColor = BackgroundColor;
    [self.contentView addSubview:hLine];
}

- (void)setModel:(FreightStatisticsModel *)model {
    
    _model = model;
    
    NSArray *arr = @[model.shipperName,//发货人
                     model.consigneeName,
                     CJStringWithFormat(@"%.2f", model.deliveryFeePractical),//金额
                     model.settleTime
    ];
    
    for (int i=0; i<arr.count; i++) {
        UILabel *textLabel = [self viewWithTag:100 + i];
        textLabel.text = arr[i];
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
